﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace ReporterControlLibrary
{
    /// <summary>
    /// Interaction logic for NewProjectDialogBox.xaml
    /// </summary>
    public partial class MessageBox : Window
    {
        public MessageBoxResult Result { get; set; }
        public MessageBoxButton Button { get; set; }
        public MessageBoxImage Image { get; set; }
        public MessageBoxOptions Options { get; set; }
        public string MessageBoxText { get; set; }
        public string Caption { get; set; }

        public static new MessageBox Show()
        {
            MessageBox mbox = new MessageBox();
            mbox.ShowDialog();
            return mbox;
        }

        public static MessageBox Show(Window owner, string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon)
        {
            MessageBox mbox = new MessageBox(owner, messageBoxText, caption, button, icon);
            mbox.ShowDialog();
            return mbox;
        }

        public MessageBox()
            : this(null, string.Empty, "Message Box", MessageBoxButton.OK, MessageBoxImage.None)
        {
        }

        // TODO: e are sorry

        public MessageBox(Window owner, string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon)
        {
            //this.Owner = owner;
            this.MessageBoxText = messageBoxText;
            this.Caption = caption;
            this.Button = button;
            this.Image = icon;

            this.DataContext = this;

            InitializeComponent();

            this.Loaded += new RoutedEventHandler(NewProjectDialogBox_Loaded);
        }

        void NewProjectDialogBox_Loaded(object sender, RoutedEventArgs e)
        {
            
        }

        private void YesButton_Click(object sender, RoutedEventArgs e)
        {
            this.Result = MessageBoxResult.Yes;
            this.DialogResult = true;
        }

        private void NoButton_Click(object sender, RoutedEventArgs e)
        {
            this.Result = MessageBoxResult.No;
            this.DialogResult = true;
        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            this.Result = MessageBoxResult.OK;
            this.DialogResult = true;
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.Result = MessageBoxResult.Cancel;
            this.DialogResult = false;
        }

        private void NoneButton_Click(object sender, RoutedEventArgs e)
        {
            this.Result = MessageBoxResult.None;
            this.DialogResult = false;
        }
    }
}
